
TRIGGER PROCEDURE FOR WRITE OF wr_route OLD BUFFER OLD_wr_route.

{mfdeclre.i }
define new shared work-table wf_old_wr_route like wr_route.

HK:
do:
    if can-find(first dt_mstr where dt_table = "wr_route" and dt_type = "SYNC") then
        run CreateSyncFlag(input "MOD", input recid(wr_route), input "wr_route").

    if not can-find ( first dt_mstr where dt_table = "wr_route" and dt_type = "MOD" ) then leave HK.
    
    if not can-find ( first wf_old_wr_route ) then do:
        create wf_old_wr_route.
        if recid(wf_old_wr_route)= -1 then .
    end.
    
    buffer-copy old_wr_route to wf_old_wr_route no-error.

    for each dt_mstr no-lock where dt_table = "wr_route" and dt_type = "MOD" :
    
        case dt_field :

            when "wr_nbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_nbr, input wr_route.wr_nbr,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_op" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_op), input string(wr_route.wr_op),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_desc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_desc, input wr_route.wr_desc,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_wkctr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_wkctr, input wr_route.wr_wkctr,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mch_op" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mch_op), input string(wr_route.wr_mch_op),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_setup" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_setup), input string(wr_route.wr_setup),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_run" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_run), input string(wr_route.wr_run),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_move" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_move), input string(wr_route.wr_move),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_act_setup" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_act_setup), input string(wr_route.wr_act_setup),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_act_run" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_act_run), input string(wr_route.wr_act_run),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_ord" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_ord), input string(wr_route.wr_qty_ord),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_wip" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_wip), input string(wr_route.wr_qty_wip),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_comp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_comp), input string(wr_route.wr_qty_comp),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_rjct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_rjct), input string(wr_route.wr_qty_rjct),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_rwrk" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_rwrk), input string(wr_route.wr_qty_rwrk),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_status" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_status, input wr_route.wr_status,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_tool" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_tool, input wr_route.wr_tool,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_vend" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_vend, input wr_route.wr_vend,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_po_nbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_po_nbr, input wr_route.wr_po_nbr,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_start" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_start), input string(wr_route.wr_start),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_due" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_due), input string(wr_route.wr_due),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lot" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_lot, input wr_route.wr_lot,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_act), input string(wr_route.wr_sub_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_yield_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_yield_pct), input string(wr_route.wr_yield_pct),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_part" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_part, input wr_route.wr_part,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_std" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_std), input string(wr_route.wr_bdn_std),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_act), input string(wr_route.wr_bdn_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_std" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_std), input string(wr_route.wr_lbr_std),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_act), input string(wr_route.wr_lbr_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_std" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_std), input string(wr_route.wr_sub_std),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_cmtindx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_cmtindx), input string(wr_route.wr_cmtindx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mch" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_mch, input wr_route.wr_mch,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_milestone" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_milestone), input string(wr_route.wr_milestone),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_user1" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_user1, input wr_route.wr_user1,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_user2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_user2, input wr_route.wr_user2,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_std_op" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_std_op, input wr_route.wr_std_op,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_setup_men" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_setup_men), input string(wr_route.wr_setup_men),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_men_mch" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_men_mch), input string(wr_route.wr_men_mch),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_tran_qty" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_tran_qty), input string(wr_route.wr_tran_qty),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_ovhd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_ovhd), input string(wr_route.wr_lbr_ovhd),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_queue" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_queue), input string(wr_route.wr_queue),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_wait" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_wait), input string(wr_route.wr_wait),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_lead" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_lead), input string(wr_route.wr_sub_lead),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_move" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_move), input string(wr_route.wr_qty_move),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__chr01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__chr01, input wr_route.wr__chr01,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__chr02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__chr02, input wr_route.wr__chr02,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__chr03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__chr03, input wr_route.wr__chr03,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__chr04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__chr04, input wr_route.wr__chr04,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__chr05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__chr05, input wr_route.wr__chr05,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__dte01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__dte01), input string(wr_route.wr__dte01),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__dte02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__dte02), input string(wr_route.wr__dte02),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__dec01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__dec01), input string(wr_route.wr__dec01),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__dec02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__dec02), input string(wr_route.wr__dec02),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__log01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__log01), input string(wr_route.wr__log01),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mtl_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mtl_totx), input string(wr_route.wr_mtl_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_totx), input string(wr_route.wr_lbr_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_totx), input string(wr_route.wr_bdn_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_totx), input string(wr_route.wr_sub_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_ovh_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_ovh_totx), input string(wr_route.wr_ovh_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lvuse_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lvuse_post), input string(wr_route.wr_lvuse_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bvuse_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bvuse_post), input string(wr_route.wr_bvuse_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_svuse_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_svuse_post), input string(wr_route.wr_svuse_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_comp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_comp), input string(wr_route.wr_sub_comp),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lvrte_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lvrte_post), input string(wr_route.wr_lvrte_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bvrte_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bvrte_post), input string(wr_route.wr_bvrte_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_svrte_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_svrte_post), input string(wr_route.wr_svrte_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lvrte_accr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lvrte_accr), input string(wr_route.wr_lvrte_accr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lvuse_accr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lvuse_accr), input string(wr_route.wr_lvuse_accr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bvrte_accr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bvrte_accr), input string(wr_route.wr_bvrte_accr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bvuse_accr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bvuse_accr), input string(wr_route.wr_bvuse_accr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_svrte_accr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_svrte_accr), input string(wr_route.wr_svrte_accr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_svuse_accr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_svuse_accr), input string(wr_route.wr_svuse_accr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lvrte_rval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lvrte_rval), input string(wr_route.wr_lvrte_rval),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lvuse_rval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lvuse_rval), input string(wr_route.wr_lvuse_rval),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bvrte_rval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bvrte_rval), input string(wr_route.wr_bvrte_rval),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bvuse_rval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bvuse_rval), input string(wr_route.wr_bvuse_rval),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_svrte_rval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_svrte_rval), input string(wr_route.wr_svrte_rval),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_svuse_rval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_svuse_rval), input string(wr_route.wr_svuse_rval),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_cost" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_cost), input string(wr_route.wr_sub_cost),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_setup_rte" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_setup_rte), input string(wr_route.wr_setup_rte),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_rate" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_rate), input string(wr_route.wr_lbr_rate),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_pct), input string(wr_route.wr_bdn_pct),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_rate" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_rate), input string(wr_route.wr_bdn_rate),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mch_bdn" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mch_bdn), input string(wr_route.wr_mch_bdn),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_slvuse_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_slvuse_post), input string(wr_route.wr_slvuse_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sbvuse_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sbvuse_post), input string(wr_route.wr_sbvuse_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_inque" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_inque), input string(wr_route.wr_qty_inque),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_outque" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_outque), input string(wr_route.wr_qty_outque),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_rejque" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_rejque), input string(wr_route.wr_qty_rejque),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_inqueb" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_inqueb), input string(wr_route.wr_qty_inqueb),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_outqueb" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_outqueb), input string(wr_route.wr_qty_outqueb),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_rejqueb" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_rejqueb), input string(wr_route.wr_qty_rejqueb),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumrjct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumrjct), input string(wr_route.wr_qty_cumrjct),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumoscrap" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumoscrap), input string(wr_route.wr_qty_cumoscrap),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumrscrap" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumrscrap), input string(wr_route.wr_qty_cumrscrap),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumoadj" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumoadj), input string(wr_route.wr_qty_cumoadj),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumradj" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumradj), input string(wr_route.wr_qty_cumradj),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cummove" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cummove), input string(wr_route.wr_qty_cummove),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumproc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumproc), input string(wr_route.wr_qty_cumproc),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_qty_cumrwrk" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_qty_cumrwrk), input string(wr_route.wr_qty_cumrwrk),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_po_line" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_po_line), input string(wr_route.wr_po_line),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_wipmtl_part" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_wipmtl_part, input wr_route.wr_wipmtl_part,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mtl_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mtl_act), input string(wr_route.wr_mtl_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mv_nxt_op" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mv_nxt_op), input string(wr_route.wr_mv_nxt_op),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_ll_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_ll_act), input string(wr_route.wr_lbr_ll_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_ll_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_ll_act), input string(wr_route.wr_bdn_ll_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_ll_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_ll_act), input string(wr_route.wr_sub_ll_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mtl_ll_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mtl_ll_act), input string(wr_route.wr_mtl_ll_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_ovh_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_ovh_act), input string(wr_route.wr_ovh_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_ovh_ll_act" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_ovh_ll_act), input string(wr_route.wr_ovh_ll_act),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_lbr_ll_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_lbr_ll_totx), input string(wr_route.wr_lbr_ll_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_bdn_ll_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_bdn_ll_totx), input string(wr_route.wr_bdn_ll_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sub_ll_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_sub_ll_totx), input string(wr_route.wr_sub_ll_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_mtl_ll_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_mtl_ll_totx), input string(wr_route.wr_mtl_ll_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_ovh_ll_totx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_ovh_ll_totx), input string(wr_route.wr_ovh_ll_totx),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_auto_lbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_auto_lbr), input string(wr_route.wr_auto_lbr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_ca_int_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_ca_int_type, input wr_route.wr_ca_int_type,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_covered_amt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_covered_amt), input string(wr_route.wr_covered_amt),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_curr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_curr, input wr_route.wr_curr,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_end_time" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_end_time, input wr_route.wr_end_time,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_eng_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_eng_code, input wr_route.wr_eng_code,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fcg_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_fcg_code, input wr_route.wr_fcg_code,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fcg_index" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_fcg_index), input string(wr_route.wr_fcg_index),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fis_column" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_fis_column), input string(wr_route.wr_fis_column),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fis_sort" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_fis_sort, input wr_route.wr_fis_sort,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fsc_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_fsc_code, input wr_route.wr_fsc_code,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fsm_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_fsm_type, input wr_route.wr_fsm_type,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_list_pr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_list_pr), input string(wr_route.wr_list_pr),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_price" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_price), input string(wr_route.wr_price),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_prod_line" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_prod_line, input wr_route.wr_prod_line,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_st_time" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_st_time, input wr_route.wr_st_time,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_act_posted" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_act_posted), input string(wr_route.wr_act_posted),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_expense" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_expense), input string(wr_route.wr_expense),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_covered_post" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_covered_post), input string(wr_route.wr_covered_post),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadd05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qadd05), input string(wr_route.wr__qadd05),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_sv_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_sv_code, input wr_route.wr_sv_code,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_posted_run" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_posted_run), input string(wr_route.wr_posted_run),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_flbr_std" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_flbr_std), input string(wr_route.wr_flbr_std),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_flbr_cstd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_flbr_cstd), input string(wr_route.wr_flbr_cstd),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_project" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_project, input wr_route.wr_project,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr_um, input wr_route.wr_um,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_fbdn_std" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_fbdn_std), input string(wr_route.wr_fbdn_std),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_itm_line" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_itm_line), input string(wr_route.wr_itm_line),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadc01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__qadc01, input wr_route.wr__qadc01,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadc02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__qadc02, input wr_route.wr__qadc02,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadc03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__qadc03, input wr_route.wr__qadc03,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadc04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_wr_route.wr__qadc04, input wr_route.wr__qadc04,
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qade01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qade01), input string(wr_route.wr__qade01),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qade02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qade02), input string(wr_route.wr__qade02),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qade03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qade03), input string(wr_route.wr__qade03),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qade04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qade04), input string(wr_route.wr__qade04),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadi01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qadi01), input string(wr_route.wr__qadi01),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadi02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qadi02), input string(wr_route.wr__qadi02),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadl01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qadl01), input string(wr_route.wr__qadl01),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr__qadl02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr__qadl02), input string(wr_route.wr__qadl02),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

            when "wr_unprocessed_amt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_wr_route.wr_unprocessed_amt), input string(wr_route.wr_unprocessed_amt),
                    input recid(wr_route), input wr_route.wr_nbr, input string(wr_route.wr_op), input wr_route.wr_lot, input "",
                    input "", input "", input "", input "").

        end.
    end.
end.

{hkdttrans.i}
